function func() {
    
}

var urlform = "http://img.qiushibaike.com/system/avtnew/head/uid/thumb/iconpath"
var defaulticon = "images/thumb_avatar.png"

function getavitorbyuser(user){
    if(null===user||undefined===user)
    return defaulticon;
    else{
        return getavitor(user.id,user.icon)
    }
}

function getavitor(uid,icon){
    if(null===uid||undefined===uid||null===icon||undefined===icon){
         //console.log("url :" +defaulticon);
        return defaulticon
    }
    else if(appWindow.showimage){
        var b = urlform;
        b = b.replace("iconpath",icon);
        b = b.replace("uid",uid);

        var uidhead = uid.slice(0,uid.length-4);
        b = b.replace("head",uidhead);
       // console.log("url :" +b);
        return b;
    }
    else{
        return defaulticon
    }
}

var smallimg = "http://img.qiushibaike.com/system/pictures/head/qiushiid/small/imgsrc"
var mediumimg = "http://img.qiushibaike.com/system/pictures/head/qiushiid/medium/imgsrc"
//取小图
function getsmall(obj,qiushiid,imgsrc){
    console.log(appWindow.showimage+"kantu ma ?");
     if(null===qiushiid||undefined===qiushiid||null===imgsrc||undefined===imgsrc)
    {
         this.visible = false;
         return "";
     }
     else if(appWindow.showimage){
         var b = smallimg;
         b = b.replace("imgsrc",imgsrc);
         b = b.replace("qiushiid",qiushiid);

         var uidhead = qiushiid.slice(0,qiushiid.length-4);
         b = b.replace("head",uidhead);
         //console.log("url :" +b);
         return b;

   }
     else{
         return "images/thumb_pic.png";
     }

}
function gettag(obj,tag){
    if(null===tag||undefined===tag||""===tag){
        obj.visible=false
        return ""
    }
    else{
        return tag
    }
}

function getimageurl(qiushiid,imgsrc){
    var b = mediumimg;
    b = b.replace("imgsrc",imgsrc);
    b = b.replace("qiushiid",qiushiid);

    var uidhead = qiushiid.slice(0,qiushiid.length-4);
    b = b.replace("head",uidhead);
   // console.log("url :" +b);
    return b
}

function showimage(qiushiid,imgsrc){
    imageview.visible = true;
    indicator1.visible =true
    var  imgsrcnew = imgsrc;
    //console.log("imgsrc in js :"+imgsrcnew);
    try{
        imgsrcnew = getimageurl(qiushiid,imgsrc);
    imageid.source = imgsrcnew;
    }
    catch(e){
        console.log(e);
        imageid.source = "images/notfound.jpg";
    }
    indicator1.visible =false;

  //  closeimage.visible = true;

}
